package cn.com.cuixk;

import java.util.Arrays;

/**
 * Create By Cuixk
 * 2019/4/9 09:25
 */
public class TwoSum {
    public static int[] twoSum(int[] nums, int target) {
        int[] ints = new int[2];
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length; j++) {
                if (i != j) {
                    if (nums[i] + nums[j] == target) {
                        ints[0] = j;
                        ints[1] = i;

                    }
                }
            }
        }
        return ints;
    }

    public static void main(String[] args) {
        int[] arr = new int[2];
        arr[0] = 3;
        arr[1] = 3;
        System.out.println(Arrays.toString(twoSum(arr, 6)));
    }
}
